home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / adms1_1.lha / Kroz / Kroz.lang < prev    next >
Text File  |  1994-07-14  |  22KB  |  748 lines

  1. ;
  2. ; Language for Kroz I by Adam Dawes.
  3. ;
  4.  
  5.  
  6. ; --- movement handling ---
  7.  
  8. verb = .direction
  9.    syntax = direction
  10.       a = cango player direction       ; can we go this way?
  11.       if a = noroom                    ; nope...
  12.          submove                       ; don't increment turn counter
  13.          endparse
  14.       endif
  15.       move player a                    ; move player to wherever he's going
  16.  
  17.       gosub .findlight                 ; is there any light here?
  18.       if a = false                     ; no
  19.          eprint "It is dark.^"
  20.       endif
  21.  
  22.       printshortdesc                   ; one-line description of room
  23.  
  24.       a = superbriefon
  25.       if a = false
  26.          a = verboseon
  27.          if a = true                         ; 'verbose' mode is on
  28.             printlongdesc                    ; long room description
  29.          endif
  30.          if a = false                        ; 'brief' mode is on
  31.             a = hasroom location entered     ; been here before?
  32.             if a = false
  33.                printlongdesc                 ; no -- so give long desc.
  34.             endif
  35.          endif
  36.       endif
  37.  
  38.       giveroom location entered              ; we have now been here
  39.  
  40.       a = children location            ; how many objects in this location?
  41.       if a = 1                         ; 1 = me, no others
  42.          endparse
  43.       endif
  44.       s = 0                            ; use stream 0
  45.       o = location                     ; list objects in current location
  46.       gosub .listobjects      
  47.       endparse
  48.  
  49.  
  50.  
  51. ; --- object manipulation ---
  52.  
  53. verb = get
  54.    syntax = verb noun
  55.       a = carried noun1
  56.       if a = true
  57.          eprint "You're already carrying it!^"
  58.       endif
  59.       a = nearto noun1
  60.       if a = false
  61.          eprint "It's not here!"
  62.       endif
  63.       a = getparent noun1        ; a is now the parent of the target obj
  64.       if a <> location           ; the object is inside/on top of something
  65.          b = has a openable      ; is the object's parent openable?
  66.          if b = true
  67.             b = has a open       ; and is it open?
  68.             if b = false
  69.                eprint "I can't see @a1 @n1!^"
  70.             endif
  71.          endif
  72.          print "(from the "
  73.          printobjshort a
  74.          print ")^"
  75.       endif
  76.       a = has noun1 static
  77.       if a = true
  78.          eprint "As hard as you try, you just can not lift the @n1.^"
  79.       endif
  80.       a = has noun1 scenery
  81.       if a = true
  82.          eprint "You can't take that!^"
  83.       endif
  84.       move noun1 player
  85.       eprint "Taken.^"
  86.    syntax = verb word
  87.       eprint "It's not here!^"
  88.  
  89. verb = drop
  90.    syntax = verb noun
  91.       checkcarried noun1
  92.       move noun1 location        ; drop the object
  93.       eprint "Dropped.^"
  94.    syntax = verb word
  95.       eprint "I'm not carrying any @w1!^"
  96.  
  97. verb = put
  98.    syntax = verb noun word=on noun
  99.       gosub .checklight
  100.       a = getparent noun1
  101.       if a <> player
  102.          eprint "..You're not carrying the @n1!^"
  103.       endif
  104.       a = nearto noun2
  105.       if a = false
  106.          eprint "I can't see any @n2!^"
  107.       endif
  108.       a = has noun2 supporter
  109.       if a = false
  110.          eprint "There's no good surface on the @n2.^"
  111.       endif
  112.  
  113. ;     a = weight noun1                          ; weight of src object
  114. ;     b = wused noun2                           ; used weight of dst obj
  115. ;     c = wcapacity noun2                       ; total capacity of dst obj
  116. ;     a = a + b                  ; too much weight on there already
  117. ;     if a > c
  118. ;        eprint "There's no room on the @n2.^"
  119. ;     endif
  120.  
  121. ;     a = oused noun2                           ; used capacity of dst obj
  122. ;     b = ocapacity noun2                       ; total capacity of dst obj
  123. ;     a = a + 1
  124. ;     if a > b                   ; too many objects on there already
  125. ;        eprint "There's no room on the @n2.^"
  126. ;     endif
  127.  
  128.       move noun1 noun2                          ; put n1 on n2
  129.       eprint "You put the @n1 on the @n2.^"
  130.    syntax = verb word word=on word
  131.       eprint "I don't have any @w1!^"
  132.    syntax = verb noun word=on word
  133.       eprint "I don't see any @w2!^"
  134.    syntax = verb noun word=in noun
  135.       a = getparent noun1
  136.       if a <> player
  137.          eprint "..You're not carrying the @n1!^"
  138.       endif
  139.       a = nearto noun2
  140.       if a = false
  141.          eprint "I can't see any @n2!^"
  142.       endif
  143.  
  144.       a = has noun2 container
  145.       if a = false
  146.          eprint "..And how exactly do I put things in the @n2?^"
  147.       endif
  148.       a = has noun2 openable        ; can the container be opened?
  149.       if a = true
  150.          a = has noun2 open         ; if so, is it open?
  151.          if a = false
  152.             eprint "You'd better open the @n2 first!^"
  153.          endif
  154.       endif
  155.  
  156. ;     a = weight noun1                          ; weight of src object
  157. ;     b = wused noun2                           ; used capacity of dst obj
  158. ;     c = wcapacity noun2                       ; total capacity of dst obj
  159. ;     a = a + b
  160. ;     if a > c             ; too much weight in there already
  161. ;        eprint "There's no room in the @n2.^"
  162. ;     endif
  163.  
  164. ;     a = oused noun2                           ; used capacity of dst obj
  165. ;     b = ocapacity noun2                       ; total capacity of dst obj
  166. ;     a = a + 1
  167. ;     if a > b             ; too many objects in there already
  168. ;        eprint "There's no room in the @n2.^"
  169. ;     endif
  170.  
  171.       move noun1 noun2                          ; put n1 in n2
  172.       eprint "You put the @n1 in the @n2.^"
  173.    syntax = verb word word=in word
  174.       eprint "I don't have any @w1!^"
  175.    syntax = verb noun word=in word
  176.       eprint "I don't see any @w2!^"
  177.  
  178.  
  179.  
  180. verb = eat
  181.    syntax = verb noun
  182.       checkcarried noun1
  183.       a = has noun1 edible
  184.       if a = false
  185.          eprint "It doesn't look very appetising..^"
  186.       endif
  187.       move noun1 trashcan     ; object goes to trashcan (see rooms file)
  188.       eprint "You eat the @n1.^"
  189.    syntax = verb word
  190.       eprint "You're not carrying any @w1!^"
  191.  
  192. verb = examine
  193.    syntax = verb noun
  194.       gosub .checklight
  195.  
  196.       a = nearto noun1
  197.       if a = false
  198.          eprint "I can't see any @n1!^"
  199.       endif
  200.  
  201.       if noun1 = window
  202.          a = has curtain open
  203.          if a = false
  204.             eprint "Your view of the window is somewhat obscured by \
  205.                      the curtain hanging in front of it.^"
  206.          endif
  207.       endif
  208.  
  209.       printobjfull noun1
  210.       a = has noun1 openable
  211.       if a = true
  212.          a = has noun1 open
  213.          if a = true
  214.             print "It is open.^"
  215.          endif
  216.          if a = false
  217.             print "It is closed.^"
  218.          endif
  219.       endif
  220.       a = has noun1 switchable
  221.       if a = true
  222.          a = has noun1 on
  223.          if a = true
  224.             print "It is switched on.^"
  225.          endif
  226.          if a = false
  227.             print "It is switched off.^"
  228.          endif
  229.       endif
  230.  
  231.       a = has noun1 container
  232.       if a = true
  233.          a = has noun1 openable -open     ; is it openable, but closed?
  234.          if a = false
  235.             a = children noun1
  236.             if a = 0
  237.                print "The @n1 is empty.^"
  238.             endif
  239.             if a <> 0
  240.                print "In the @n1:^"
  241.                s = 1    ; objstream 1 so that indentation is increased
  242.                o = noun1
  243.                gosub .listobjects
  244.             endif
  245.          endif
  246.       endif
  247.       a = has noun1 supporter
  248.       if a = true
  249.          a = children noun1
  250.          if a <> 0
  251.             print "On the @n1:^"
  252.             s = 1
  253.             o = noun1
  254.             gosub .listobjects
  255.          endif
  256.       endif
  257.       endparse
  258.    syntax = verb word
  259.       gosub .checklight
  260.       eprint "I can't see any @w1!^"
  261.  
  262.  
  263. verb = open
  264.    syntax = verb noun
  265.       gosub .checklight
  266.       a = nearto noun1
  267.       if a = false
  268.          eprint "I can't see any @n1!^"
  269.       endif
  270.       a = has noun1 openable
  271.       if a = false
  272.          eprint "The @n1 doesn't seem to open!^"
  273.       endif
  274.       a = has noun1 lockable           ; is the thing lockable?
  275.       if a = true
  276.          a = has noun1 locked          ; is it locked?
  277.          if a = true
  278.             eprint "The @n1 seems to be locked.^"
  279.          endif
  280.       endif
  281.       a = has noun1 open
  282.       if a = true
  283.          eprint "The @n1 is open already!^"
  284.       endif
  285.       give noun1 open
  286.       print "The @n1 is now open.^"
  287.  
  288.       if noun1 = curtain
  289.          giveroom location light       ; we can see now
  290.          a = has switch taken       ; is this the first time we've seen?
  291.          if a = false
  292.             give switch taken       ; no longer the first time
  293.             printshortdesc
  294.             printlongdesc
  295.             a = children location      ; how many objects in this location?
  296.             if a = 1                   ; 1 = me, no others
  297.                endparse
  298.             endif
  299.             s = 0                      ; use stream 0
  300.             o = location               ; list objects in current location
  301.             gosub .listobjects      
  302.             endparse
  303.          endif
  304.       endif
  305.       a = has noun1 container
  306.       if a = true
  307.          a = children noun1
  308.          if a = 0
  309.             print "The @n1 is empty.^"
  310.          endif
  311.          if a <> 0
  312.             print "In the @n1:^"
  313.             s = 1
  314.             o = noun1
  315.             gosub .listobjects
  316.          endif
  317.       endif
  318.       endparse
  319.    syntax = verb word
  320.       eprint "I can't see any @w1!^"
  321.  
  322.  
  323. verb = close
  324.    syntax = verb noun
  325.       gosub .checklight
  326.       a = nearto noun1
  327.       if a = false
  328.          eprint "I can't see any @n1!^"
  329.       endif
  330.       a = has noun1 openable
  331.       if a = false
  332.          eprint "I don't know how to close the @n1!^"
  333.       endif
  334.       a = has noun1 open
  335.       if a = false
  336.          eprint "The @n1 is closed already!^"
  337.       endif
  338.       give noun1 -open
  339.       print "The @n1 is now closed.^"
  340.  
  341.       if noun1 = curtain
  342.          a = has switch on             ; is the light on?
  343.          if a = false
  344.             giveroom location -light         ; oops -- it's dark
  345.             gosub .findlight
  346.             if a = false
  347.                eprint "It's now dark.^"
  348.             endif
  349.          endif
  350.       endif
  351.       endparse
  352.    syntax = verb word
  353.       eprint "I can't see any @w1!^"
  354.  
  355.  
  356. verb = unlock
  357.    syntax = verb noun word=with noun
  358.       gosub .checklight
  359.       a = nearto noun1
  360.       if a = false
  361.          eprint "I can't see any @n1!^"
  362.       endif
  363.       a = getparent noun2
  364.       if a <> player
  365.          eprint "You're not carrying @a2 @n2!^"
  366.       endif
  367.       a = has noun1 lockable
  368.       if a = false
  369.          eprint "I'm not entirely sure how to go about unlocking the @n1!^"
  370.       endif
  371.       a = has noun1 locked
  372.       if a = false
  373.          eprint "But the @n1 isn't locked!"
  374.       endif
  375.       eprint "The @n2 doesn't seem to unlock the @n1..^"
  376.    syntax = verb noun
  377.       eprint "What do you want to unlock the @n1 with?^"
  378.    syntax = verb word word=with any
  379.       eprint "I can't see any @w1!^"
  380.    syntax = verb noun word=with word
  381.       eprint "I can't see any @w2!^"
  382.  
  383. verb = lock
  384.    syntax = verb noun word=with noun
  385.       gosub .checklight
  386.       a = nearto noun1
  387.       if a = false
  388.          eprint "I can't see any @n1!^"
  389.       endif
  390.       a = getparent noun2
  391.       if a <> player
  392.          eprint "You're not carrying @a2 @n2!^"
  393.       endif
  394.       a = has noun1 lockable
  395.       if a = false
  396.          eprint "I'm not entirely sure how to go about locking the @n1!^"
  397.       endif
  398.       a = has noun1 locked
  399.       if a = true
  400.          eprint "But the @n1 is already locked!"
  401.       endif
  402.       a = has noun1 openable
  403.       if a = true
  404.          a = has noun1 open
  405.          if a = true
  406.             eprint "You'd better close the @n1 first..^"
  407.          endif
  408.       endif
  409.       eprint "The @n2 doesn't seem to lock the @n1..^"
  410.    syntax = verb noun
  411.       eprint "What do you want to lock the @n1 with?^"
  412.    syntax = verb word word=with any
  413.       eprint "I can't see any @w1!^"
  414.    syntax = verb noun word=with word
  415.       eprint "I can't see any @w2!^"
  416.  
  417.  
  418. verb = turn
  419.    syntax = verb word=on noun
  420.       a = nearto noun1
  421.       if a = false
  422.          eprint "I can't see any @n1!^"
  423.       endif
  424.  
  425.       a = noun1                        ; copy noun1 to a
  426.       if a = light                     ; are we turning on the light?
  427.          a = switch                    ; yes, actually turn on the switch
  428.       endif
  429.  
  430.       b = has a switchable
  431.       if b = false
  432.          eprint "I don't see any way of turning the @n1 on!^"
  433.       endif
  434.       b = has a on
  435.       if b = true
  436.          eprint "The @n1 is already turned on!^"
  437.       endif
  438.  
  439.       give a on               ; switch on the object
  440.       print "You turn on the @n1.^"
  441.  
  442.       if a = switch
  443.          giveroom location light    ; turn on the light
  444.          if noun1 = switch       ; don't do this if 'turn on light'
  445.             print "A light bursts into life above you..^^"
  446.          endif
  447.  
  448.          give light on           ; the light is on aswell as the switch!
  449.  
  450.          a = has switch taken    ; taken flag tells us if it's the first time
  451.          if a = false
  452.             give switch taken       ; no longer the first time
  453.             printshortdesc
  454.             printlongdesc
  455.             a = children location            ; how many objects in this location?
  456.             if a = 1                         ; 1 = me, no others
  457.                endparse
  458.             endif
  459.             s = 0                            ; use stream 0
  460.             o = location                     ; list objects in current location
  461.             gosub .listobjects      
  462.             endparse
  463.          endif
  464.       endif
  465.       endparse
  466.    syntax = verb word=off noun
  467.       a = nearto noun1
  468.       if a = false
  469.          eprint "I can't see any @n1!^"
  470.       endif
  471.  
  472.       a = noun1                        ; copy noun1 to a
  473.       if a = light                     ; are we turning on the light?
  474.          a = switch                    ; yes, actually turn on the switch
  475.       endif
  476.  
  477.       b = has a switchable
  478.       if b = false
  479.          eprint "I don't see any way of turning the @n1 off!^"
  480.       endif
  481.       b = has a on
  482.       if b = false
  483.          eprint "The @n1 is already turned off!^"
  484.       endif
  485.  
  486.       give a -on                 ; turn the thing off
  487.       print "You turn the @n1 off.^"
  488.  
  489.       if a = switch
  490.          give light -on             ; the light object is off too!
  491.          a = has curtain open       ; is the curtain open?
  492.          if a = false               ; no.. so..
  493.             giveroom location -light      ; take away the light
  494.          endif
  495.          gosub .findlight
  496.          if a = false
  497.             eprint "It's now dark!^"
  498.          endif
  499.       endif
  500.       endparse
  501.    syntax = verb word=on
  502.       eprint "What do you want to turn on?"
  503.    syntax = verb word=off
  504.       eprint "What do you want to turn off?"
  505.    syntax = verb noun
  506.       eprint "The @n1 doesn't seem to turn!^"
  507.       
  508.  
  509.  
  510. ; --- game commands ---
  511.  
  512. verb = look
  513.    syntax = verb
  514.       gosub .checklight                ; is there any light here?
  515.  
  516.       printshortdesc
  517.       printlongdesc
  518.       a = children location            ; how many objects in this location?
  519.       if a = 1                         ; 1 = me, no others
  520.          endparse
  521.       endif
  522.       s = 0                            ; use stream 0
  523.       o = location                     ; list objects in current location
  524.       gosub .listobjects      
  525.       endparse
  526.  
  527.  
  528. verb = inventory
  529.    syntax = any
  530.       print "You are carrying:^"
  531.       a = children player              ; how many objects am I carrying?
  532.       if a = 0
  533.          eprint "  Nothing.^"
  534.       endif
  535.       s = 1                            ; indentation straight away
  536.       o = player                       ; list my objects
  537.       gosub .listobjects
  538.       endparse
  539.  
  540.  
  541. verb = .listobjects  ; recursively list al objects contained within 'o'
  542.    syntax = any
  543.       resetstream s o
  544.       loop
  545.          a = getstreamobj s            ; get obj from stream
  546.          if a = noobject
  547.             exitloop                   ; reached the end
  548.          endif
  549.          if a <> player                ; check it's not me!
  550.             b = has a scenery          ; is it scenery?
  551.             if b = false
  552.                if s = 0
  553.                   printobjlong a          ; say what the object is (long)
  554.                endif
  555.                if s <> 0
  556.                   gosub .doindent
  557.                   printarticle a
  558.                   printobjshort a         ; say what the object is (short)
  559.                   print "^"
  560.                endif
  561.                b = children a             ; see how many children it has
  562.                if b <> 0
  563.                   c = 0                   ; not ok to show children
  564.                   b = has a container
  565.                   if b = true
  566.                      c = 1                ; it's a container
  567.                      d = has a openable -open   ; is it openable but closed?
  568.                      if d = true
  569.                         c = 0       ; contents is not visible..
  570.                      endif
  571.                   endif
  572.                   b = has a supporter
  573.                   if b = true
  574.                      c = 2             ; it's a supporter
  575.                   endif
  576.                   if c <> 0                  ; it's ok to show the children..
  577.                      gosub .doindent
  578.                      if c = 1
  579.                         print "In the "
  580.                      endif
  581.                      if c = 2
  582.                         print "On the "
  583.                      endif
  584.                      printobjshort a
  585.                      print ":^"
  586.  
  587.                      push o                  ; store the current obj
  588.                      s = s + 1               ; increase stream value
  589.                      o = a                   ; get new object to scan
  590.                      gosub .listobjects      ; say what's in/on this object
  591.                      s = s - 1               ; return to original stream
  592.                      o = pop                 ; get back old object
  593.                   endif
  594.                endif
  595.             endif
  596.          endif
  597.       endloop
  598.       return
  599.  
  600. verb = .doindent                       ; do indentation for object lists
  601.    syntax = any
  602.       if s = 0
  603.          return
  604.       endif
  605.       r = s                            ; copy stream value
  606.       loop
  607.          print " "
  608.          r = r - 1
  609.          if r = 0
  610.             exitloop
  611.          endif
  612.       endloop
  613.       return
  614.  
  615. verb = .findlight
  616.    syntax = any
  617.       a = hasroom location light
  618.       if a = true
  619.          return                  ; light is here, return with 'true' in a
  620.       endif
  621.       a = false                  ; no light here!
  622.       return
  623.  
  624. verb = .checklight
  625.    syntax = any
  626.       a = hasroom location light
  627.       if a = true
  628.          return                  ; light is here, return
  629.       endif
  630.       eprint "It's dark, I can't see a thing!^" ;no light, end parsing
  631.  
  632.  
  633. ; --- miscellaneous commands ---
  634.  
  635. verb = wait
  636.    syntax = any
  637.       print "Time passes..^"
  638.       endparse
  639.  
  640. verb = quit
  641.    syntax = any
  642.       submove
  643.       a = confirm "Are you sure you want to quit? "
  644.       if a = false
  645.          eprint "No.^"
  646.       endif
  647.       print "Yes.^^Your score is @cs out of a possible @ms, in @tn turns.^^"
  648.       getcr
  649.       quit
  650.  
  651. verb = score
  652.    syntax = any
  653.       submove
  654.       eprint "Your score is @cs out of a possible @ms in @tn turns."
  655.  
  656. verb = restore
  657.    syntax = any
  658.       load
  659.  
  660. verb = save
  661.    syntax = any
  662.       submove
  663.       save
  664.  
  665. verb = restart
  666.    syntax = any
  667.       submove
  668.       a = confirm "Are you sure you want to restart? "
  669.       if a = false
  670.          eprint "No.^"
  671.       endif
  672.       print "Yes.^^"
  673.       restart
  674.  
  675.  
  676. verb = verbose
  677.    syntax = any
  678.       verbose
  679.       eprint "Verbose mode activated.^"
  680.  
  681. verb = brief
  682.    syntax = any
  683.       brief
  684.       eprint "Brief mode activated.^"
  685.  
  686. verb = superbrief
  687.    syntax = any
  688.       superbrief
  689.       eprint "Superbrief mode activated.^"
  690.  
  691. ; --- preset special verbs ---
  692.  
  693.  
  694. verb = .startgame
  695.    syntax = any
  696.       printmsg 1
  697.  
  698. ;     printshortdesc
  699. ;     printlongdesc
  700. ;     a = children location      ; how many objects in this location?
  701. ;     if a = 1                   ; 1 = me, no others
  702. ;        endparse
  703. ;     endif
  704.  
  705. ;     s = 0                      ; use stream 0
  706. ;     o = location               ; list objects in current location
  707. ;     gosub .listobjects
  708. ;     endparse
  709.  
  710.       eprint "It is dark.^"
  711.  
  712. ; --- misc special verbs ---
  713.  
  714.  
  715. verb = .intovortex               ; sucked into vortex from kitchen
  716.    syntax = any
  717.       print "A huge blast of air blows from behind you towards the \
  718.             vortex, and it knocks you to the floor. Unable to find \
  719.             anything to hold on to, you are unable to prevent yourself \
  720.             from being dragged head-first into the vortex.^^You seem to \
  721.             fall through thin air for a very long time, before landing \
  722.             heavily on damp ground. You slowly come to your senses and \
  723.             look around..^^"
  724.       move player ropebridge
  725.  
  726.  
  727.       printshortdesc
  728.  
  729.       a = superbriefon
  730.       if a = false
  731.          a = verboseon
  732.          if a = true                         ; 'verbose' mode is on
  733.             printlongdesc
  734.          endif
  735.          if a = false                        ; 'brief' mode is on
  736.             a = hasroom location entered     ; been here before?
  737.             if a = false
  738.                printlongdesc
  739.             endif
  740.          endif
  741.       endif
  742.       giveroom location entered
  743.          
  744.       s = 0                      ; use stream 0
  745.       o = location               ; list objects in current location
  746.       gosub .listobjects
  747.       endparse
  748.